home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 3d_lib.zip / MXZ.C < prev    next >
C/C++ Source or Header  |  1993-05-09  |  876b  |  37 lines

  1. /* Find maximum z coordinate in face
  2.  
  3.    Copyright (c) 1988 by Gus O'Donnell
  4.  
  5.    Revision history:
  6.  
  7.    Version 1.00         February 29, 1988       As released.
  8.  
  9.    Version 1.01         March 20, 1988          Created libraries for all
  10.                                                 memory models
  11.  
  12. */
  13. #include "3d.h"
  14. #include <float.h>
  15. #include <math.h>
  16. #include <stdio.h>
  17. #include <values.h>
  18.  
  19. double  max_z (FACE this_face)
  20.  
  21. /* Find the maximum z coordinate in the face. */
  22.  
  23. {
  24.     double result;
  25.     CORNER *chandle;    /* Pointer for traversing the corner list. */
  26.  
  27.     chandle = this_face.first -> next;
  28.     result = -MAXDOUBLE;
  29.     while (chandle -> next != NULL)
  30.     {
  31.         if (chandle -> this -> coord [2] > result)
  32.             result = chandle -> this -> coord [2];
  33.         chandle = chandle -> next;
  34.     }
  35.     return(result);
  36. }
  37.